from celery import Celery  # 异步任务模块
import os  # 系统模块

os.environ.setdefault('DJANGO_SETTINGS_MODULE','drfstudy22.settings')

app = Celery('drfstudy22')  # 创建名为drfstudy22的Celery应用

# 加载Celery配置,任务队列
app.config_from_object('celery_tasks.celery_config')
# 导入任务
app.autodiscover_tasks(['celery_tasks.email'])